using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;

using ILRuntime.CLR.TypeSystem;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using ILRuntime.Runtime.Stack;
using ILRuntime.Reflection;
using ILRuntime.CLR.Utils;
using System.Linq;

namespace ILRuntime.Runtime.Generated
{
    unsafe class AssetsChecker_Binding
    {
        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
        {
            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
            MethodBase method;
            FieldInfo field;
            Type[] args;
            Type type = typeof(global::AssetsChecker);
            args = new Type[]{};
            method = type.GetMethod("get_Pos", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, get_Pos_0);
            args = new Type[]{};
            method = type.GetMethod("get_Length", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, get_Length_1);
            args = new Type[]{};
            method = type.GetMethod("get_Done", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, get_Done_2);
            args = new Type[]{typeof(global::INIReader), typeof(global::INIReader), typeof(System.String), typeof(System.Action<global::AssetsChecker>)};
            method = type.GetMethod("CheckAsync", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, CheckAsync_3);

            field = type.GetField("Parts", flag);
            app.RegisterCLRFieldGetter(field, get_Parts_0);
            app.RegisterCLRFieldSetter(field, set_Parts_0);
            app.RegisterCLRFieldBinding(field, CopyToStack_Parts_0, AssignFromStack_Parts_0);
            field = type.GetField("maxLength", flag);
            app.RegisterCLRFieldGetter(field, get_maxLength_1);
            app.RegisterCLRFieldSetter(field, set_maxLength_1);
            app.RegisterCLRFieldBinding(field, CopyToStack_maxLength_1, AssignFromStack_maxLength_1);
            field = type.GetField("RootSection", flag);
            app.RegisterCLRFieldGetter(field, get_RootSection_2);
            app.RegisterCLRFieldSetter(field, set_RootSection_2);
            app.RegisterCLRFieldBinding(field, CopyToStack_RootSection_2, AssignFromStack_RootSection_2);
            field = type.GetField("IgnoreSection", flag);
            app.RegisterCLRFieldGetter(field, get_IgnoreSection_3);
            app.RegisterCLRFieldSetter(field, set_IgnoreSection_3);
            app.RegisterCLRFieldBinding(field, CopyToStack_IgnoreSection_3, AssignFromStack_IgnoreSection_3);


            app.RegisterCLRCreateDefaultInstance(type, () => new global::AssetsChecker());
            app.RegisterCLRCreateArrayInstance(type, s => new global::AssetsChecker[s]);

            args = new Type[]{};
            method = type.GetConstructor(flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Ctor_0);

        }


        static StackObject* get_Pos_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            global::AssetsChecker instance_of_this_method = (global::AssetsChecker)typeof(global::AssetsChecker).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.Pos;

            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static StackObject* get_Length_1(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            global::AssetsChecker instance_of_this_method = (global::AssetsChecker)typeof(global::AssetsChecker).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.Length;

            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static StackObject* get_Done_2(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            global::AssetsChecker instance_of_this_method = (global::AssetsChecker)typeof(global::AssetsChecker).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.Done;

            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method ? 1 : 0;
            return __ret + 1;
        }

        static StackObject* CheckAsync_3(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 5);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Action<global::AssetsChecker> @callBack = (System.Action<global::AssetsChecker>)typeof(System.Action<global::AssetsChecker>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)8);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.String @assetsFolder = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            global::INIReader @buildIn = (global::INIReader)typeof(global::INIReader).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 4);
            global::INIReader @all = (global::INIReader)typeof(global::INIReader).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 5);
            global::AssetsChecker instance_of_this_method = (global::AssetsChecker)typeof(global::AssetsChecker).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.CheckAsync(@all, @buildIn, @assetsFolder, @callBack);

            return __ret;
        }


        static object get_Parts_0(ref object o)
        {
            return ((global::AssetsChecker)o).Parts;
        }

        static StackObject* CopyToStack_Parts_0(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((global::AssetsChecker)o).Parts;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_Parts_0(ref object o, object v)
        {
            ((global::AssetsChecker)o).Parts = (global::AssetsChecker.AssetsPart[])v;
        }

        static StackObject* AssignFromStack_Parts_0(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            global::AssetsChecker.AssetsPart[] @Parts = (global::AssetsChecker.AssetsPart[])typeof(global::AssetsChecker.AssetsPart[]).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((global::AssetsChecker)o).Parts = @Parts;
            return ptr_of_this_method;
        }

        static object get_maxLength_1(ref object o)
        {
            return ((global::AssetsChecker)o).maxLength;
        }

        static StackObject* CopyToStack_maxLength_1(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((global::AssetsChecker)o).maxLength;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_maxLength_1(ref object o, object v)
        {
            ((global::AssetsChecker)o).maxLength = (System.Int32)v;
        }

        static StackObject* AssignFromStack_maxLength_1(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Int32 @maxLength = ptr_of_this_method->Value;
            ((global::AssetsChecker)o).maxLength = @maxLength;
            return ptr_of_this_method;
        }

        static object get_RootSection_2(ref object o)
        {
            return ((global::AssetsChecker)o).RootSection;
        }

        static StackObject* CopyToStack_RootSection_2(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((global::AssetsChecker)o).RootSection;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_RootSection_2(ref object o, object v)
        {
            ((global::AssetsChecker)o).RootSection = (System.String)v;
        }

        static StackObject* AssignFromStack_RootSection_2(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.String @RootSection = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((global::AssetsChecker)o).RootSection = @RootSection;
            return ptr_of_this_method;
        }

        static object get_IgnoreSection_3(ref object o)
        {
            return ((global::AssetsChecker)o).IgnoreSection;
        }

        static StackObject* CopyToStack_IgnoreSection_3(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((global::AssetsChecker)o).IgnoreSection;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_IgnoreSection_3(ref object o, object v)
        {
            ((global::AssetsChecker)o).IgnoreSection = (System.String)v;
        }

        static StackObject* AssignFromStack_IgnoreSection_3(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.String @IgnoreSection = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((global::AssetsChecker)o).IgnoreSection = @IgnoreSection;
            return ptr_of_this_method;
        }



        static StackObject* Ctor_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* __ret = ILIntepreter.Minus(__esp, 0);

            var result_of_this_method = new global::AssetsChecker();

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }


    }
}
